<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <input type="button" id="btn" value="点击按钮">
  <script>
    // 获取元素
    var btn = document.getElementById("btn");
    // 点击按钮出现一个随机数
    var isopen = true;
    btn.onclick = function (){
        if(isopen){
            console.log(Math.random());
            isopen = false;
        }else{
           return;
        }
    setTimeout(function(){
        isopen = true;
    },1000);
    }

  </script>
</body>
</html>